package cn.edu.gdut.deepcode.constant;

import java.util.concurrent.TimeUnit;

/**
 * <p>
 * 缓存常量
 * </p>
 *
 * @Author: 暮倦
 * @Since: 2025-04-11  23:48
 * @Version: 1.0.0
 */
public class CacheConstant {
    public static final String GLOBAL_ID_USER_KEY = "global:id:user";
    public static final String GLOBAL_ID_CANVAS_KEY = "global:id:canvas";
    public static final String GLOBAL_ID_CANVAS_ELEMENT_KEY_PREFIX = "global:id:canvas:element:";
    public static final String GLOBAL_ID_CANVAS_ELEMENT_VERSION_KEY_PREFIX = "global:id:canvas:element:version";
    public static final String GLOBAL_ID_SNAPSHOT_GENERATION_TASK_CONSUMER_KEY = "global:id:snapshot:gen:task";
    public static final String CANVAS_SHARED_CODE_PREFIX = "canvas:shared:code:";

    public static final String CANVAS_SNAPSHOT_GENERATION_TASK_STATUS_KEY_PREFIX = "gen:snapshot:task:status:";
    public static final String CANVAS_SNAPSHOT_VERSION_KEY_PREFIX = "snapshot:version:";
    public static final String CANVAS_SNAPSHOT_GENERATION_TASK_STARTING_STATUS = "1";
    public static final String CANVAS_SNAPSHOT_GENERATION_TASK_STREAM_KEY_PREFIX="snapshot:gen:task:stream:";
    public static final String CANVAS_SNAPSHOT_GENERATION_TASK_GROUP_NAME_PREFIX="snapshot:gen:task:group:";
    public static final String CANVAS_SNAPSHOT_GENERATION_TASK_CONSUMER_NAME_PREFIX="snapshot:gen:task:consumer:";
    public static final Integer CANVAS_SNAPSHOT_GENERATION_TASK_DATA_BATCH_SIZE=1000;
//    public static final String CANVAS_SNAPSHOT_GENERATION_TASK_FINISHED_STATUS = "0";
    public static final Long CANVAS_SNAPSHOT_GENERATION_TASK_STATUS_KEY_EXPIRE_TIME = 10L;
    public static final TimeUnit CANVAS_SNAPSHOT_GENERATION_TASK_STATUS_KEY_EXPIRE_TIME_UNIT = TimeUnit.MINUTES;

    public static final String CANVAS_INFO_LIST_CACHE_KEY_PREFIX ="canvas:info:list:cache:";
    public static final String CANVAS_INFO_VALUE_CACHE_KEY_PREFIX ="canvas:info:value:cache:";
    public static final String CANVAS_INFO_LOCK_KEY_PREFIX="canvas:info:lock:";


    public static final String CANVAS_SNAPSHOT_CACHE_KEY_PREFIX ="canvas:snapshot:cache:";
    public static final String CANVAS_SNAPSHOT_LOCK_KEY_PREFIX="canvas:snapshot:lock:";
 

    public static final Long COMMON_EXPIRE_TIME=30L;
    public static final TimeUnit COMMON_EXPIRE_TIME_UNIT=TimeUnit.DAYS;
    public static final Long COMMON_LOCK_EXPIRE_TIME =30L;
    public static final TimeUnit COMMON_LOCK_EXPIRE_TIME_UNIT =TimeUnit.SECONDS;


    public static final String SHARED_CODE_SEPARATOR = "-";
    public static final Long PERMANENT = -1L;
    public static final Long EXPIRED = 0L;
}


